package net.uiiang.android.alkaid.utils;

import java.io.IOException;

import android.media.MediaPlayer;

public class MediaPlayerUtil {
    private MediaPlayer mediaPlayer;

    private boolean isPlaying() {
        return mediaPlayer.isPlaying();
    }

    private void pause() {
        mediaPlayer.pause();
    }

    private void prepare() {
        try {
            mediaPlayer.prepare();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private void release() {
        mediaPlayer.release();
    }

    private void reset() {
        mediaPlayer.reset();
    }

    private void setDataSource(String path) {
        try {
            mediaPlayer.setDataSource(path);
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private void setLooping(boolean looping) {
        mediaPlayer.setLooping(looping);
    }

    private void start() {
        mediaPlayer.start();
    }

    private void stop() {
        mediaPlayer.stop();
    }
}
